package org.biodas.jdas.util;

import org.apache.log4j.Logger;
import org.biodas.jdas.schema.sources.COORDINATES;

public class CoordinateUtil {
//Logger logger=Logger.getLogger(CoordinateUtil.class);
	/**
	 * get the organism from the coordinate (gets it from the element content)
	 * @param coord 
	 * @return organism name if exists else "" to indicate any organism
	 */
	public static String getOrganismName(COORDINATES coord){
	String[] chunks = coord.getContent().split(",");
	if (chunks.length > 2) {
		String coordOrganism = chunks[2];
		return coordOrganism;
	}
	return "";
	}
	
	public static boolean equals(COORDINATES coord1, COORDINATES coord2){
		//logger.debug(coord1.getUri()+"="+coord2.getUri());
		if(coord1.getUri().equals(coord2.getUri()))
		{
			return true;
		}else{
			return false;
		}
		
	}
}
